from django.urls import path
from . import views

app_name = 'custom_admin'

urlpatterns = [
    # 认证相关
    path('login/', views.admin_login, name='login'),
    path('logout/', views.admin_logout, name='logout'),
    
    # 仪表盘
    path('', views.dashboard, name='dashboard'),
    path('dashboard/', views.dashboard, name='dashboard'),
    
    # 文章管理
    path('articles/', views.article_list, name='article_list'),
    path('articles/create/', views.article_create, name='article_create'),
    path('articles/<int:pk>/edit/', views.article_edit, name='article_edit'),
    path('articles/<int:pk>/delete/', views.article_delete, name='article_delete'),
    path('articles/<int:pk>/submit-for-review/', views.article_submit_for_review, name='article_submit_for_review'),
    path('articles/<int:pk>/publish/', views.article_publish, name='article_publish'),
    path('articles/<int:pk>/withdraw/', views.article_withdraw, name='article_withdraw'),
    
    # 文章审核
    path('article-reviews/', views.article_review_list, name='article_review_list'),
    path('article-reviews/<int:pk>/first-review/', views.article_first_review, name='article_first_review'),
    path('article-reviews/<int:pk>/final-review/', views.article_final_review, name='article_final_review'),
    
    # 分类管理
    path('categories/', views.category_list, name='category_list'),
    path('categories/create/', views.category_create, name='category_create'),
    path('categories/<int:pk>/edit/', views.category_edit, name='category_edit'),
    path('categories/<int:pk>/delete/', views.category_delete, name='category_delete'),
    path('categories/<int:pk>/review-process/', views.category_review_process, name='category_review_process'),
    
    # 部门管理
    path('departments/', views.department_list, name='department_list'),
    path('departments/create/', views.department_create, name='department_create'),
    path('departments/<int:pk>/create-sub/', views.department_create_sub, name='department_create_sub'),
    path('departments/<int:pk>/edit/', views.department_edit, name='department_edit'),
    path('departments/<int:pk>/delete/', views.department_delete, name='department_delete'),
    
    # 用户组管理
    path('user-groups/', views.user_group_list, name='user_group_list'),
    path('user-groups/create/', views.user_group_create, name='user_group_create'),
    path('user-groups/<int:pk>/edit/', views.user_group_edit, name='user_group_edit'),
    path('user-groups/<int:pk>/delete/', views.user_group_delete, name='user_group_delete'),
    
    # 权限组管理
    path('permission-groups/', views.permission_group_list, name='permission_group_list'),
    path('permission-groups/create/', views.permission_group_create, name='permission_group_create'),
    path('permission-groups/<int:pk>/edit/', views.permission_group_edit, name='permission_group_edit'),
    path('permission-groups/<int:pk>/delete/', views.permission_group_delete, name='permission_group_delete'),
    
    # 权限管理
    path('permissions/', views.permission_list, name='permission_list'),
    path('permissions/create/', views.permission_create, name='permission_create'),
    path('permissions/<int:pk>/edit/', views.permission_edit, name='permission_edit'),
    path('permissions/<int:pk>/delete/', views.permission_delete, name='permission_delete'),
    
    # UEditor处理
    path('ueditor/', views.ueditor_handler, name='ueditor_handler'),
]